home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #2 / Ham Radio 2000 - Volume 2.iso / HAMV2 / ANTENNA / YAGIU112 / V.C < prev    next >
C/C++ Source or Header  |  1995-08-18  |  637b  |  36 lines

  1. #include <stdio.h>
  2. #include <math.h>
  3. #include <errno.h>
  4. #include "yagi.h"
  5. extern int errno;
  6.  
  7. void fill_v_vector(int driven, int parasitic, double **driven_data, double *v)
  8. {
  9.     double real, imaginary;
  10.     int i, elements=driven+parasitic;
  11.  
  12.     for(i=1;i<=elements;i++)        /* fill driven elements */
  13.     {
  14.         if(i<=driven)
  15.         {
  16.             real      = driven_data[i][VOLTAGE_R];
  17.             imaginary = driven_data[i][VOLTAGE_I];
  18.             v[2*i-1]=real;
  19.             v[2*i]=imaginary;
  20.         }
  21.         else  /* zero parasitic elements */
  22.         {
  23.             v[2*i-1]=0.0;
  24.             v[2*i]=0.0;
  25.         }
  26.     }
  27.  
  28. #ifdef DEBUG
  29.     if(errno)
  30.     {
  31.         fprintf(stderr,"Errno =%d in fill_v_vector() of v.c\n", errno);
  32.         exit(1);
  33.     }
  34. #endif
  35. }
  36.